#include <iostream>

using namespace std;

int week[7];
int months[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int T;

int main()
{
	cin >> T;
	
	int day = 0;
	int year = 1900;
	
	while (T -- )
	{
		for (int i = 1; i <= 12; i ++ )
		{
			week[(day + 12) % 7] ++ ;
			
			day += months[i];
			
			if ( i == 2 && (year % 400 == 0 || year % 4 == 0 && year % 100)) day ++ ;
		} 
		
		year ++ ;
	}
	
	for (int i = 5, j = 0; j < 7; j ++ , i ++ )
	{
		cout << week[i % 7] << ' ';
	}
	
	return 0;
} 
